using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class damgeZone : MonoBehaviour
{
    public int damageNum = -1;
    //设置受伤血量
    private void OnTriggerStay2D(Collider2D other)  //ruby呆在指定区域中就调用函数扣血
    {
        RubyController rubyController = other.GetComponent<RubyController>();
        //获取ruby对象
        if (rubyController != null) //判断获取的对象不为空
        {
            rubyController.changeHealth(damageNum);
        }
    }
}
